#include "stdafx.h"
#include <string>

using namespace std;

class MockBase
{
public:
	MockBase()
		: name("MockBase")
	{
		IncreaseCount();
	}
	
	virtual ~MockBase() {}

	const char* GetClassName()
	{
		char tempName[20];
		sprintf(tempName, "%d\0", num);
		
		return name.append(tempName).c_str();				
	}

	static void ClearCount() {num = 0;}

	virtual int VirtualTest()
	{
		return 1;
	}
protected:
	static void IncreaseCount() {++num; }
	string name;
	static int num;
};

int MockBase::num = 0;

class MockDerive : public MockBase
{
public:
	MockDerive() :
		MockBase()
	{
		IncreaseCount();
		name = "MockDerive";
	}

	virtual ~MockDerive() {}

	virtual int VirtualTest()
	{
		return 2;
	}
};